package chkui.springcore.example.hybrid.beanmanipulation.bean;

import java.util.Date;
import java.text.DateFormat;

import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.PropertyEditorRegistry;
import org.springframework.beans.propertyeditors.CustomDateEditor;

public class DateFormatRegistrar implements PropertyEditorRegistrar {

	@Override
	public void registerCustomEditors(PropertyEditorRegistry registry) {
		DateFormat df = new java.text.SimpleDateFormat("yyyy-MM-dd");
		CustomDateEditor editor = new CustomDateEditor(df, false);
		registry.registerCustomEditor(Date.class, editor);
	}
}
